package com.lsh.oms.core.enums;

/**
 * Project Name: PayType
 * 北京链商电子商务有限公司
 * @author wangliutao
 * Date: 18/6/6
 * Package Name: com.lsh.oms.core.enums
 * Description:
 */
public enum PayType implements AbstractEnum<Integer> {
    /**
     *
     */
    PAY_ON_DELIVERY(1, "货到付款"),
    ONLINE_PAYMENT(2, "在线支付"),
    OPEN_ACCOUNT(3, "账期赊销"),
    PRE_PAYMENT(4, "预付金额");

    private final Integer value;

    private final String desc;

    PayType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public static String getName(int value) {
        for (PayType payType : PayType.values()) {
            if (payType.value == value) {
                return payType.desc;
            }
        }
        return null;
    }

    public static PayType indexOf(int value) {
        for (PayType payType : PayType.values()) {
            if (payType.value == value) {
                return payType;
            }
        }
        return null;
    }

}
